package com.wulin.wucut;

import cn.hutool.core.thread.RejectPolicy;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;

@Configuration
public class ThreadPoolConfig{
    
    
    @Bean
    public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
        ThreadPoolTaskExecutor poolTaskExecutor = new ThreadPoolTaskExecutor();
        poolTaskExecutor.setCorePoolSize(3);
        poolTaskExecutor.setMaxPoolSize(10);
        poolTaskExecutor.setThreadNamePrefix("wuling-thread-pool-");
        poolTaskExecutor.setQueueCapacity(100);
        return poolTaskExecutor;
    }
    
    

}
